<template>
  <div>
    <div>count1:{{ count1 }}<button @click="count1++">+</button></div>
    <div>count2:{{ count2 }}<button @click="count2++">+</button></div>
  </div>
</template>
<!-- 
    vue3监听多个ref变量的语法
    watch([ref变量1，ref变量2],(newval,oldval)=>{},配置对象)
 -->
<script lang='ts' setup>
import {ref,watch} from 'vue'
const count1=ref<number>(10)
const count2=ref<number>(20)
watch([count1,count2],(newval,oldaval)=>{
    console.log('newval',newval);
    console.log('oldval',oldaval);
    
    
})
</script>

<style lang='scss' scoped>
</style>